Scrapbox import用json
キーと型
code:import_json.ts
type ImportJson = {
pages: {
title: string;
created?: number;
updated?: number;
id?: string;
lines: {
text: string;
created?: number;
updated?: number;
id?: string;
}[];
}[];
};
エクスポートしたjsonと比較すると、pages.titleとpages.lines.text以外は入れておくと反映されるっぽい
pages.lines.textは他に属性を付加しない場合はtextを省略できるっぽい
サンプルはこんな感じになる
code:sample.json
{
"pages": [
{
"title": "page1",
"created": 234,
"updated": 234,
"id": "1212",
"lines": [
{ "text": "page1" },
{ "text": "" },
{ "text": "honbun" },
{ "text": "test" },
{ "text": "test" }
]
},
{"title":"page2","created":999,"updated":999,"id":"1212",
},
{"title":"page3","created":44,"updated":44,"id":"1212",
},
{"title":"page4","created":200,"updated":200,"id":"1212",
},
{"title":"page5","created":1234,"updated":1234,"id":"1212",
}
]
}